home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / GDeviceTest.cp < prev    next >
Encoding:
Text File  |  1993-01-14  |  1.6 KB  |  54 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1992 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Originator: Kent Sandvik
  5.   Date: Wednesday, June 3, 1992 10:10:46
  6.   Revision comments are at the end of this file.
  7.   ---
  8.   TGDevice is a GDevice utility class, finding out GDevice information.
  9.   GDeviceTest.cp contains the class testing functions.
  10.   _________________________________________________________________________________________________________ */
  11.  
  12. #ifndef _GDEVICE_
  13. #include "GDevice.h"
  14. #endif
  15.  
  16. // This test will scan through all the GDevices on the system, and print
  17. // out the base address, row, and the depth size.
  18.  
  19. void main(void)
  20. {
  21.     Ptr aBase;
  22.     long aRow;
  23.     short aDepth;
  24.  
  25.     cout << "TGDevice test \n";
  26.  
  27.     // Iterate through all the screens connected to the system.
  28.     for (TGDevice myScreens; !myScreens.Last(); myScreens.Next())
  29.     {
  30.         aBase = myScreens.GetBase();
  31.         aRow = myScreens.GetRow();
  32.         aDepth = myScreens.GetDepth();
  33.  
  34.         printf("Base address = %X\n", aBase);
  35.         fflush(stdout);                            // cout was broken (MPW) concerning %X
  36.         cout << "Row = " << aRow;
  37.         cout << "\n";
  38.         cout << "Depth = " << aDepth;
  39.         cout << "\n";
  40.     }
  41. }
  42.  
  43. // _________________________________________________________________________________________________________ //
  44.  
  45.  
  46. /*    Change History (most recent last):
  47.   No        Init.    Date        Comment
  48.   1            khs        6/2/92        New file
  49.   2            khs        7/5/92        First decent release
  50.   3            khs        9/7/92        Changed the structure of the classes
  51. */
  52.  
  53.  
  54.